﻿//公共共同脚本
var ApiUrl = "http://localhost:6260/";/* http://120.24.174.19:801/  */
var LoginUserID = "1";
var LoginUserAccount = "zhangsan"
var LoginUserName = "张三";
var isall = true;
(function (factory) {
    if (typeof define === "function" && define.amd) {
        define(["jquery", "../js/jquery.min"], factory);
    } else {
        factory();
    }
}(function () {
    //前台判断是否有令牌，否则直接跳转登录页面
    var storage = window.localStorage;
    var ticket = storage.getItem('token');
    if (ticket == null || ticket == "" || ticket == undefined) {
        location.href = "login.html";
        isall = false;
    } else {
        var userid = storage.getItem('userid');
        var account = storage.getItem('account');
        var name = storage.getItem('name');
        var pwd = storage.getItem('pwd');
        if (userid == null || userid == "" || userid == undefined ||
           account == null || account == "" || account == undefined ||
           name == null || name == "" || name == undefined ||
           pwd == null || pwd == "" || pwd == undefined) {
            location.href = "login.html";
            isall = false;
        } else {
            LoginUserID = userid;
            LoginUserAccount = account;
            LoginUserName = name;
        }
    }
}));
